home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Online / Epic4 / share / epic / help / 6_functions / isnumber < prev    next >
Text File  |  2001-03-21  |  1KB  |  34 lines

  1. Synopsis:
  2.    $isalpha(<text>)
  3.    $isdigit(<text>)
  4.    $isnumber(<text> <base>>)
  5.  
  6. Technical:
  7.    These function test whether the first character in the given string is
  8.    an alphabetical character or a digit.  Only the first character is
  9.    tested.
  10.    
  11.    The function $isnumber() is very similar to $isdigit(), except that
  12.    it takes two arguments, the second specifying the numeric base of <text>.
  13.    The second argument must be prefixed with a 'b'; eg. "b8" for base 8, "b16"
  14.    for base 16. And as always, numbers in base 16 may be prefixed with "0x".
  15.  
  16. Practical:
  17.    These functions are useful for testing an input string to see whether it
  18.    is a number or a text string.  One use for this might be to check if it
  19.    would be suitable input for $iptoname() or $nametoip().  Keep in mind
  20.    that only the first character is tested, so this isn't a reliable way
  21.    to see if the entire string is a number.
  22.  
  23. Returns:
  24.    "true" or "false" value if first character is a letter or a digit
  25.  
  26. Examples:
  27.    $isalpha(hello)         returns true
  28.    $isalpha(2hello)        returns false
  29.    $isdigit(123)           returns true
  30.    $isdigit(2abc)          returns true
  31.    $isdigit(a123)          returns false
  32.    $isnumber(0x9FF b16)    returns true
  33.  
  34.